<!--组件-二级菜单,line大于文字宽度-->
<template>
  <div class="bg">
    <div :class="[type == 0 ? '' : 'all']"  v-for="(name, index) in menus" v-bind:key="index"  @click="menuClick(index)">
      <div class="but">
        <text :class="['font32', 'text', menu == index ? 'text2' : 'text3']">{{name}}</text>
      </div>
      
      <div class="acenter">
        <div :class="['line', menu == index ? 'main1' : '']"></div>
      </div>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.bg {
  flex-direction: row;
  padding-left: 30px;
  padding-right: 30px;
  height: 80px;
}

.but {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding-left: 30px;
  padding-right: 30px;
}

.text {
  flex: 1;
  text-align: center;
  lines:1;
  text-overflow: ellipsis;
}
.line {
  width: 160px;
  height: 6px;
  border-radius: 3px;
}
</style>

<script>

export default {
  props:{
    type:{
      type:Number,
      default:0, //0左对齐，1均分
    },

    menu: {
      type:Number,
      default:0,
    },

    menus: {
      type:Array,
      default:[],
    },
  },
  
  data() {
    return {
    };
  },

  mounted(){
    
  },

  methods:{

    /********************************** 点击触发*/
    menuClick(index){
      this.$emit("menuClick",index);
    },
  }
}
</script>
